<?php

class LeftModel extends Model{
	
	// left 
	/* 获取最热的商品 */
	public function getHot(){
		$sql = 'select goods_id, goods_name, shop_price from goods where is_hot = 1 order by goods_id desc limit 6 ';
		return $this->db->getAll($sql);
	}
	
	/* 获取栏目信息 */
	public function get_cat_list(){
		$sql = 'select cat_id, cat_name, parent_id from category where cat_id < 10 order by cat_id asc';
		$catList = $this->db->getAll($sql);
		foreach($catList as $key => $val){
			$sql = 'select cat_id, cat_name, parent_id from category where parent_id = ' . $val['cat_id'] . ' order by cat_id asc';
			$catList[$key]['son'] = $this->db->getAll($sql);
		}
		return $catList;
	}
	
	
	
	
}









